<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');

class Featured extends MX_Controller {

	
	function __construct()
	{
		parent::__construct();
		$this->load->model('listing/listing_model');
		//$this->load->model('location/location_model');
		$this->load->model('category/category_model');
		$this->load->model('featured_model');				
	}

	function showListing($city=0,$limit=5){
		
		if($city == 0){
			$sql = "select * from profile where featured = 1 order by RAND()  limit $limit";
		}
		
		$data['featued'] = $this->db->query($sql)->result();
		
		$this->load->view('featured',$data);
		
	}
	
	function showHomePage($limit=0){
		$sql = "select * from profile where featured = 1 order by RAND()  limit $limit";
		$data['featued'] = $this->db->query($sql)->result();
	
		$this->load->view('featured_home_page',$data);
	
	}
	
	/*function details()
	{
		$featured_id = $this->commoncall->get_id(current_url());
		
		$data['featured']['details'] = $this->featured_model->getFeatured_deatils($featured_id);
		
		$this->template->set_layout('inner_layout');
		$this->template->build('profile',$data);
	}
	*/
}
/* End of file */